{% extends 'base/admin_base.html' %}

{% block title %}
  新闻标签
{% endblock %}

{% block hedaer %}
  新闻标签管理
{% endblock %}

{% block content %}
  <!-- 伪代码 -->

  {# primary 蓝色  danger 红色 warning 黄色 info success #}
  {# lg md sm xs #}

  <div class="col-md-12 col-xs-12 col-sm-12">
    <div class="box">
      <div class="box-header">
        <a href="javascript:void(0);" class="btn btn-info pull-right" id="btn-add-tag">添加分类</a>
      </div>
      <div class="box-body">
        <table class="table table-bordered table-hover">
          <thead>
          <tr>
            <th>标签名称</th>
            <th>新闻数量</th>
            <th>操作</th>
          </tr>
          </thead>
          <tbody>
          {% for tag in tags %}
            <tr>
            <!-- 自定义属性 -->
              <td data-id="{{ tag.id }}" data-name="{{ tag.name }}">{{ tag.name }}</td>
               <!-- tag.news_set.count -->
              <td>{{ tag.news.count }}</td>
              <td>
                <button class="btn btn-sm btn-warning btn-edit">编辑</button>
                <button class="btn btn-sm btn-danger btn-del">删除</button>
              </td>
            </tr>
          {% endfor %}
          </tbody>
        </table>
      </div>
    </div>
  </div>
{% endblock %}

{% block srcipt %}
  {# 没引入 js   #}
  <script src="{% static 'js/admin/news/news_tags.js' %}"></script>
{% endblock %}